//
//  LJTopicChildCell.m
//  BaseProject
//
//  Created by 王洋 on 2020/12/14.
//  Copyright © 2020 王洋. All rights reserved.
//

#import "LJTopicChildCell.h"

@implementation LJTopicChildCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)layoutSubviews {
    [super layoutSubviews];
    
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.01 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        [self pp_clipCorners:UIRectCornerAllCorners radius:self.frame.size.height/2];
    });
}

- (void)fillWithModel:(ProClassificationModel *)model {
    
    self.mainTitleLab.text = model.parentName;

    if (model.isHot) {
        self.hotIcon.hidden = NO;
    } else {
        self.hotIcon.hidden = YES;
    }
    
    if (model.isOther) {
        
        self.hotIcon.hidden = YES;
        self.backgroundColor = UIColorHex(0xFFF7F1);
        [self.tagIcon setImage:[UIImage imageNamed:@"more_topic"]];
        self.mainTitleLab.textColor = UIColorHex(0xFF7200);

    } else {

        self.backgroundColor = UIColorHex(0xF5F5F5);
        [self.tagIcon setImage:[UIImage imageNamed:@"topic_normal"]];
        self.mainTitleLab.textColor = UIColorHex(0x333333);

        
    }
}

@end
